#include <cellcsp.h>
#include <string>
#include <stdio.h>
#include <csp_debug.h>




int main(){

	char *file = "./tasks/big_load_heavy_computations_task";
	
	CSPConfig conf;

	conf.add_csp_program(file, "big_load_heavy_computations_task");


	//CellCSP_start(conf, &kernel);
	CellCSP_start(conf);

	printf("Running parallel_test with file: %s\n", file);
	
	CSPProcess init0( "big_load_heavy_computations_task");
	CSPProcess init1( "big_load_heavy_computations_task");
	CSPProcess init2( "big_load_heavy_computations_task");
	CSPProcess init3( "big_load_heavy_computations_task");
	CSPProcess init4( "big_load_heavy_computations_task");
	CSPProcess init5( "big_load_heavy_computations_task");
	CSPProcess init6( "big_load_heavy_computations_task");
	CSPProcess init7( "big_load_heavy_computations_task");
	CSPProcess init8( "big_load_heavy_computations_task");
	CSPProcess init9( "big_load_heavy_computations_task");
	CSPProcess init10("big_load_heavy_computations_task");
	CSPProcess init11("big_load_heavy_computations_task");
	CSPProcess init12("big_load_heavy_computations_task");
	CSPProcess init13("big_load_heavy_computations_task");
	CSPProcess init14("big_load_heavy_computations_task");
	CSPProcess init15("big_load_heavy_computations_task");
	CSPProcess init16("big_load_heavy_computations_task");
	CSPProcess init17("big_load_heavy_computations_task");
	CSPProcess init18("big_load_heavy_computations_task");
	CSPProcess init19("big_load_heavy_computations_task");
	CSPProcess init20("big_load_heavy_computations_task");
	CSPProcess init21("big_load_heavy_computations_task");
	CSPProcess init22("big_load_heavy_computations_task");
	CSPProcess init23("big_load_heavy_computations_task");
	CSPProcess init24("big_load_heavy_computations_task");
	CSPProcess init25("big_load_heavy_computations_task");
	CSPProcess init26("big_load_heavy_computations_task");
	CSPProcess init27("big_load_heavy_computations_task");
	CSPProcess init28("big_load_heavy_computations_task");
	CSPProcess init29("big_load_heavy_computations_task");



	//init.Run();
	Parallel par(&init0,
				 &init1, 
				 &init2, 
				 &init3, 
				 &init4, 
				 &init5, 
                 &init6,
                 &init7,
                 &init8,
                 &init9,
				 &init10,
				 &init11, 
				 &init12, 
				 &init13, 
				 &init14, 
				 &init15, 
                 &init16,
                 &init17,
                 &init18,
                 &init19,
				 &init20,
				 &init21, 
				 &init22, 
				 &init23, 
				 &init24, 
				 &init25, 
                 &init26,
                 &init27,
                 &init28,
                 &init29,
				 NULL) ; 
	par.Run();
	
	
	/*
	CSPProcess mytask2("mytask1");
	mytask2.Run();
	*/

	CellCSP_end();
	
	return 0;
}
